#{extends 'home.html' /}


#{if flash.success}
		<h2 style="color:GREEN"> <img src="@{'public/images/tick-icon.png'}"/> ${flash.success}</h2>
		#{/if}
<h1 class="viewTitle">Drafts</h1> 

<div class="viewContent">

#{if drafts.size()==0 && draftRequests.size()==0}
		<h2>No items saved as draft</h2>
#{/if}
#{else}
<table  cellspacing="0" cellpadding="0">

<tr>
	<th>Draft Item</th>
	<th>Draft Type</th>
	<th>Saved At</th>
</tr>

	 #{list drafts, as:'draft'}
			<tr>
				<td><a href="@{ProfileController.viewDraft(draft.id)}">${draft.title}</a></td>
				<td>Idea</td>
				<td> ${draft.date.format('dd/MM/yyyy hh:mm')}</td>
			</tr>
	 #{/list} 
	 #{list draftRequests, as:'draftRequest'}
			<tr>
				<td><a href="@{ProfileController.viewDraftRequest(draftRequest.id)}">${draftRequest.name}</a></td>
				<td>Topic Request</td>
				<td>${draftRequest.date.format('dd/MM/yyyy hh:mm')}</td>
			</tr>
	 #{/list}
#{/else}
</table>
</div>